﻿using System;

namespace SLNGP.Core.Genes
{
    public class ScalarFunctionGeneDefintion<T> : IGeneDefinition
        where T : struct 
    {
        private Delegate _scalarFunction;
        private string _symbol;

        public ScalarFunctionGeneDefintion(Func<T, T, T> func, string symbol)
        {
            _scalarFunction = func;
            _symbol = symbol;
        }

        public IGene Create()
        {
            return new ScalarFunctionGene<int>(_scalarFunction, _symbol) { GeneDefinition = this };
        }
    }
}